package com.lc.user.express.my;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lc.user.express.R;
import com.lc.user.express.app.AppContext;
import com.lc.user.express.httpserver.GetAbout;
import com.zcx.helper.http.AsyCallBack;


/**
 * Created by Administrator on 2016/8/18.
 */
public class MyAboutActivity extends FragmentActivity implements View.OnClickListener {

//    private RelativeLayout fanhui;
    private TextView dizhi;
    private TextView dizhijuti;
    private TextView phonenum;
private TextView head_left;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.guanyu);
        initviews();
    }

    @Override
    protected void onResume() {
        super.onResume();
        inflush();
    }

    private void inflush() {
        new GetAbout(new AsyCallBack<GetAbout.Info>(){
            @Override
            public void onSuccess(String toast, int type, GetAbout.Info info) throws Exception {
                super.onSuccess(toast, type, info);
                dizhi.setText(info.web_address);
                dizhijuti.setText(info.web_tiyan);
                phonenum.setText("联系电话："+info.web_tel+"     "+info.web_hotline);
            }
        }).execute(this);

    }

    private void initviews() {
        dizhi = (TextView) findViewById(R.id.dizhi);
        dizhijuti = (TextView) findViewById(R.id.dizhijuti);
        phonenum = (TextView) findViewById(R.id.phonenum);
//        fanhui = (RelativeLayout) findViewById(R.id.account_fanhui);
//        fanhui.setOnClickListener(this);
        head_left= (TextView) findViewById(R.id.head_left);
        head_left.setOnClickListener(this);
    }

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        ViewGroup viewGroup = (ViewGroup) getWindow().getDecorView();
        AppContext.ScaleScreenHelper.loadView(viewGroup);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.account_fanhui:
                finish();
                break;

            case R.id.head_left:
                finish();
                break;
        }
    }
}
